using System;
using System.Collections;
using System.Collections.Specialized;

namespace Thinxoft.HttpLib
{
	/// <summary>
	/// Represents the context of a running application on the Xedus server
	/// </summary>
	public interface IHttpApplicationContext
	{
		/// <summary>
		/// Adds an object to the application
		/// </summary>
		/// <param name="key"></param>
		/// <param name="val"></param>
		void Add(object key, object val);

		/// <summary>
		/// Removes an object from the application 
		/// </summary>
		/// <param name="key"></param>
		void Remove(object key);

		/// <summary>
		/// returns an enumeration of objects contained in the application
		/// </summary>
		/// <returns></returns>
		IDictionaryEnumerator GetEnumerator();

		/// <summary>
		/// Returns the  number of objects currently in the application
		/// </summary>
		int Count
		{
			get
				;
			
		}

		/// <summary>
		/// returns an objects by key from the application
		/// </summary>
		object this[object key]
		{
			get;set;
				 
		}

		/// <summary>
		/// creates a new HttpSession for the application given a session Id  This method should not be called
		/// as it overwrites the curent session id that session Id is given and will not create a useable session
		/// otherwise
		/// </summary>
		/// <param name="sessionId"></param>
		/// <returns></returns>
		IHttpSession CreateNewSession(string sessionId);
	}
}
